3.1.8 \(\int x^5 (a+b \sec (c+d x^2))^2 \, dx\) [8]

3.1.8.1 Optimal result
3.1.8.2 Mathematica [A] (verified)
3.1.8.3 Rubi [A] (verified)
3.1.8.4 Maple [F]
3.1.8.5 Fricas [B] (verification not implemented)
3.1.8.6 Sympy [F]
3.1.8.7 Maxima [F]
3.1.8.8 Giac [F]
3.1.8.9 Mupad [F(-1)]

3.1.8.1 Optimal result

Integrand size = 18, antiderivative size = 242 \[ \int x^5 \left (a+b \sec \left (c+d x^2\right )\right )^2 \, dx=-\frac {i b^2 x^4}{2 d}+\frac {a^2 x^6}{6}-\frac {2 i a b x^4 \arctan \left (e^{i \left (c+d x^2\right )}\right )}{d}+\frac {b^2 x^2 \log \left (1+e^{2 i \left (c+d x^2\right )}\right )}{d^2}+\frac {2 i a b x^2 \operatorname {PolyLog}\left (2,-i e^{i \left (c+d x^2\right )}\right )}{d^2}-\frac {2 i a b x^2 \operatorname {PolyLog}\left (2,i e^{i \left (c+d x^2\right )}\right )}{d^2}-\frac {i b^2 \operatorname {PolyLog}\left (2,-e^{2 i \left (c+d x^2\right )}\right )}{2 d^3}-\frac {2 a b \operatorname {PolyLog}\left (3,-i e^{i \left (c+d x^2\right )}\right )}{d^3}+\frac {2 a b \operatorname {PolyLog}\left (3,i e^{i \left (c+d x^2\right )}\right )}{d^3}+\frac {b^2 x^4 \tan \left (c+d x^2\right )}{2 d} \]

output
-1/2*I*b^2*x^4/d+1/6*a^2*x^6-2*I*a*b*x^4*arctan(exp(I*(d*x^2+c)))/d+b^2*x^ 
2*ln(1+exp(2*I*(d*x^2+c)))/d^2+2*I*a*b*x^2*polylog(2,-I*exp(I*(d*x^2+c)))/ 
d^2-2*I*a*b*x^2*polylog(2,I*exp(I*(d*x^2+c)))/d^2-1/2*I*b^2*polylog(2,-exp 
(2*I*(d*x^2+c)))/d^3-2*a*b*polylog(3,-I*exp(I*(d*x^2+c)))/d^3+2*a*b*polylo 
g(3,I*exp(I*(d*x^2+c)))/d^3+1/2*b^2*x^4*tan(d*x^2+c)/d
 
3.1.8.2 Mathematica [A] (verified)

Time = 0.66 (sec) , antiderivative size = 229, normalized size of antiderivative = 0.95 \[ \int x^5 \left (a+b \sec \left (c+d x^2\right )\right )^2 \, dx=\frac {-3 i b^2 d^2 x^4+a^2 d^3 x^6-12 i a b d^2 x^4 \arctan \left (e^{i \left (c+d x^2\right )}\right )+6 b^2 d x^2 \log \left (1+e^{2 i \left (c+d x^2\right )}\right )+12 i a b d x^2 \operatorname {PolyLog}\left (2,-i e^{i \left (c+d x^2\right )}\right )-12 i a b d x^2 \operatorname {PolyLog}\left (2,i e^{i \left (c+d x^2\right )}\right )-3 i b^2 \operatorname {PolyLog}\left (2,-e^{2 i \left (c+d x^2\right )}\right )-12 a b \operatorname {PolyLog}\left (3,-i e^{i \left (c+d x^2\right )}\right )+12 a b \operatorname {PolyLog}\left (3,i e^{i \left (c+d x^2\right )}\right )+3 b^2 d^2 x^4 \tan \left (c+d x^2\right )}{6 d^3} \]

input
Integrate[x^5*(a + b*Sec[c + d*x^2])^2,x]
 
output
((-3*I)*b^2*d^2*x^4 + a^2*d^3*x^6 - (12*I)*a*b*d^2*x^4*ArcTan[E^(I*(c + d* 
x^2))] + 6*b^2*d*x^2*Log[1 + E^((2*I)*(c + d*x^2))] + (12*I)*a*b*d*x^2*Pol 
yLog[2, (-I)*E^(I*(c + d*x^2))] - (12*I)*a*b*d*x^2*PolyLog[2, I*E^(I*(c + 
d*x^2))] - (3*I)*b^2*PolyLog[2, -E^((2*I)*(c + d*x^2))] - 12*a*b*PolyLog[3 
, (-I)*E^(I*(c + d*x^2))] + 12*a*b*PolyLog[3, I*E^(I*(c + d*x^2))] + 3*b^2 
*d^2*x^4*Tan[c + d*x^2])/(6*d^3)
 
3.1.8.3 Rubi [A] (verified)

Time = 0.59 (sec) , antiderivative size = 240, normalized size of antiderivative = 0.99, number of steps used = 5, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.222, Rules used = {4692, 3042, 4678, 2009}

Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.

\(\displaystyle \int x^5 \left (a+b \sec \left (c+d x^2\right )\right )^2 \, dx\)

\(\Big \downarrow \) 4692

\(\displaystyle \frac {1}{2} \int x^4 \left (a+b \sec \left (d x^2+c\right )\right )^2dx^2\)

\(\Big \downarrow \) 3042

\(\displaystyle \frac {1}{2} \int x^4 \left (a+b \csc \left (d x^2+c+\frac {\pi }{2}\right )\right )^2dx^2\)

\(\Big \downarrow \) 4678

\(\displaystyle \frac {1}{2} \int \left (a^2 x^4+b^2 \sec ^2\left (d x^2+c\right ) x^4+2 a b \sec \left (d x^2+c\right ) x^4\right )dx^2\)

\(\Big \downarrow \) 2009

\(\displaystyle \frac {1}{2} \left (\frac {a^2 x^6}{3}-\frac {4 i a b x^4 \arctan \left (e^{i \left (c+d x^2\right )}\right )}{d}-\frac {4 a b \operatorname {PolyLog}\left (3,-i e^{i \left (d x^2+c\right )}\right )}{d^3}+\frac {4 a b \operatorname {PolyLog}\left (3,i e^{i \left (d x^2+c\right )}\right )}{d^3}+\frac {4 i a b x^2 \operatorname {PolyLog}\left (2,-i e^{i \left (d x^2+c\right )}\right )}{d^2}-\frac {4 i a b x^2 \operatorname {PolyLog}\left (2,i e^{i \left (d x^2+c\right )}\right )}{d^2}-\frac {i b^2 \operatorname {PolyLog}\left (2,-e^{2 i \left (d x^2+c\right )}\right )}{d^3}+\frac {2 b^2 x^2 \log \left (1+e^{2 i \left (c+d x^2\right )}\right )}{d^2}+\frac {b^2 x^4 \tan \left (c+d x^2\right )}{d}-\frac {i b^2 x^4}{d}\right )\)

input
Int[x^5*(a + b*Sec[c + d*x^2])^2,x]
 
output
(((-I)*b^2*x^4)/d + (a^2*x^6)/3 - ((4*I)*a*b*x^4*ArcTan[E^(I*(c + d*x^2))] 
)/d + (2*b^2*x^2*Log[1 + E^((2*I)*(c + d*x^2))])/d^2 + ((4*I)*a*b*x^2*Poly 
Log[2, (-I)*E^(I*(c + d*x^2))])/d^2 - ((4*I)*a*b*x^2*PolyLog[2, I*E^(I*(c 
+ d*x^2))])/d^2 - (I*b^2*PolyLog[2, -E^((2*I)*(c + d*x^2))])/d^3 - (4*a*b* 
PolyLog[3, (-I)*E^(I*(c + d*x^2))])/d^3 + (4*a*b*PolyLog[3, I*E^(I*(c + d* 
x^2))])/d^3 + (b^2*x^4*Tan[c + d*x^2])/d)/2
 

3.1.8.3.1 Defintions of rubi rules used

rule 2009
Int[u_, x_Symbol] :> Simp[IntSum[u, x], x] /; SumQ[u]
 

rule 3042
Int[u_, x_Symbol] :> Int[DeactivateTrig[u, x], x] /; FunctionOfTrigOfLinear 
Q[u, x]
 

rule 4678
Int[(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_))^(n_.)*((c_.) + (d_.)*(x_))^(m_.) 
, x_Symbol] :> Int[ExpandIntegrand[(c + d*x)^m, (a + b*Csc[e + f*x])^n, x], 
 x] /; FreeQ[{a, b, c, d, e, f, m}, x] && IGtQ[m, 0] && IGtQ[n, 0]
 

rule 4692
Int[(x_)^(m_.)*((a_.) + (b_.)*Sec[(c_.) + (d_.)*(x_)^(n_)])^(p_.), x_Symbol 
] :> Simp[1/n   Subst[Int[x^(Simplify[(m + 1)/n] - 1)*(a + b*Sec[c + d*x])^ 
p, x], x, x^n], x] /; FreeQ[{a, b, c, d, m, n, p}, x] && IGtQ[Simplify[(m + 
 1)/n], 0] && IntegerQ[p]
 
3.1.8.4 Maple [F]

\[\int x^{5} {\left (a +b \sec \left (d \,x^{2}+c \right )\right )}^{2}d x\]

input
int(x^5*(a+b*sec(d*x^2+c))^2,x)
 
output
int(x^5*(a+b*sec(d*x^2+c))^2,x)
 
3.1.8.5 Fricas [B] (verification not implemented)

Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 799 vs. \(2 (199) = 398\).

Time = 0.32 (sec) , antiderivative size = 799, normalized size of antiderivative = 3.30 \[ \int x^5 \left (a+b \sec \left (c+d x^2\right )\right )^2 \, dx=\frac {a^{2} d^{3} x^{6} \cos \left (d x^{2} + c\right ) + 3 \, b^{2} d^{2} x^{4} \sin \left (d x^{2} + c\right ) - 6 \, a b \cos \left (d x^{2} + c\right ) {\rm polylog}\left (3, i \, \cos \left (d x^{2} + c\right ) + \sin \left (d x^{2} + c\right )\right ) + 6 \, a b \cos \left (d x^{2} + c\right ) {\rm polylog}\left (3, i \, \cos \left (d x^{2} + c\right ) - \sin \left (d x^{2} + c\right )\right ) - 6 \, a b \cos \left (d x^{2} + c\right ) {\rm polylog}\left (3, -i \, \cos \left (d x^{2} + c\right ) + \sin \left (d x^{2} + c\right )\right ) + 6 \, a b \cos \left (d x^{2} + c\right ) {\rm polylog}\left (3, -i \, \cos \left (d x^{2} + c\right ) - \sin \left (d x^{2} + c\right )\right ) - 3 \, {\left (2 i \, a b d x^{2} - i \, b^{2}\right )} \cos \left (d x^{2} + c\right ) {\rm Li}_2\left (i \, \cos \left (d x^{2} + c\right ) + \sin \left (d x^{2} + c\right )\right ) - 3 \, {\left (2 i \, a b d x^{2} + i \, b^{2}\right )} \cos \left (d x^{2} + c\right ) {\rm Li}_2\left (i \, \cos \left (d x^{2} + c\right ) - \sin \left (d x^{2} + c\right )\right ) - 3 \, {\left (-2 i \, a b d x^{2} + i \, b^{2}\right )} \cos \left (d x^{2} + c\right ) {\rm Li}_2\left (-i \, \cos \left (d x^{2} + c\right ) + \sin \left (d x^{2} + c\right )\right ) - 3 \, {\left (-2 i \, a b d x^{2} - i \, b^{2}\right )} \cos \left (d x^{2} + c\right ) {\rm Li}_2\left (-i \, \cos \left (d x^{2} + c\right ) - \sin \left (d x^{2} + c\right )\right ) + 3 \, {\left (a b c^{2} - b^{2} c\right )} \cos \left (d x^{2} + c\right ) \log \left (\cos \left (d x^{2} + c\right ) + i \, \sin \left (d x^{2} + c\right ) + i\right ) - 3 \, {\left (a b c^{2} + b^{2} c\right )} \cos \left (d x^{2} + c\right ) \log \left (\cos \left (d x^{2} + c\right ) - i \, \sin \left (d x^{2} + c\right ) + i\right ) + 3 \, {\left (a b d^{2} x^{4} + b^{2} d x^{2} - a b c^{2} + b^{2} c\right )} \cos \left (d x^{2} + c\right ) \log \left (i \, \cos \left (d x^{2} + c\right ) + \sin \left (d x^{2} + c\right ) + 1\right ) - 3 \, {\left (a b d^{2} x^{4} - b^{2} d x^{2} - a b c^{2} - b^{2} c\right )} \cos \left (d x^{2} + c\right ) \log \left (i \, \cos \left (d x^{2} + c\right ) - \sin \left (d x^{2} + c\right ) + 1\right ) + 3 \, {\left (a b d^{2} x^{4} + b^{2} d x^{2} - a b c^{2} + b^{2} c\right )} \cos \left (d x^{2} + c\right ) \log \left (-i \, \cos \left (d x^{2} + c\right ) + \sin \left (d x^{2} + c\right ) + 1\right ) - 3 \, {\left (a b d^{2} x^{4} - b^{2} d x^{2} - a b c^{2} - b^{2} c\right )} \cos \left (d x^{2} + c\right ) \log \left (-i \, \cos \left (d x^{2} + c\right ) - \sin \left (d x^{2} + c\right ) + 1\right ) + 3 \, {\left (a b c^{2} - b^{2} c\right )} \cos \left (d x^{2} + c\right ) \log \left (-\cos \left (d x^{2} + c\right ) + i \, \sin \left (d x^{2} + c\right ) + i\right ) - 3 \, {\left (a b c^{2} + b^{2} c\right )} \cos \left (d x^{2} + c\right ) \log \left (-\cos \left (d x^{2} + c\right ) - i \, \sin \left (d x^{2} + c\right ) + i\right )}{6 \, d^{3} \cos \left (d x^{2} + c\right )} \]

input
integrate(x^5*(a+b*sec(d*x^2+c))^2,x, algorithm="fricas")
 
output
1/6*(a^2*d^3*x^6*cos(d*x^2 + c) + 3*b^2*d^2*x^4*sin(d*x^2 + c) - 6*a*b*cos 
(d*x^2 + c)*polylog(3, I*cos(d*x^2 + c) + sin(d*x^2 + c)) + 6*a*b*cos(d*x^ 
2 + c)*polylog(3, I*cos(d*x^2 + c) - sin(d*x^2 + c)) - 6*a*b*cos(d*x^2 + c 
)*polylog(3, -I*cos(d*x^2 + c) + sin(d*x^2 + c)) + 6*a*b*cos(d*x^2 + c)*po 
lylog(3, -I*cos(d*x^2 + c) - sin(d*x^2 + c)) - 3*(2*I*a*b*d*x^2 - I*b^2)*c 
os(d*x^2 + c)*dilog(I*cos(d*x^2 + c) + sin(d*x^2 + c)) - 3*(2*I*a*b*d*x^2 
+ I*b^2)*cos(d*x^2 + c)*dilog(I*cos(d*x^2 + c) - sin(d*x^2 + c)) - 3*(-2*I 
*a*b*d*x^2 + I*b^2)*cos(d*x^2 + c)*dilog(-I*cos(d*x^2 + c) + sin(d*x^2 + c 
)) - 3*(-2*I*a*b*d*x^2 - I*b^2)*cos(d*x^2 + c)*dilog(-I*cos(d*x^2 + c) - s 
in(d*x^2 + c)) + 3*(a*b*c^2 - b^2*c)*cos(d*x^2 + c)*log(cos(d*x^2 + c) + I 
*sin(d*x^2 + c) + I) - 3*(a*b*c^2 + b^2*c)*cos(d*x^2 + c)*log(cos(d*x^2 + 
c) - I*sin(d*x^2 + c) + I) + 3*(a*b*d^2*x^4 + b^2*d*x^2 - a*b*c^2 + b^2*c) 
*cos(d*x^2 + c)*log(I*cos(d*x^2 + c) + sin(d*x^2 + c) + 1) - 3*(a*b*d^2*x^ 
4 - b^2*d*x^2 - a*b*c^2 - b^2*c)*cos(d*x^2 + c)*log(I*cos(d*x^2 + c) - sin 
(d*x^2 + c) + 1) + 3*(a*b*d^2*x^4 + b^2*d*x^2 - a*b*c^2 + b^2*c)*cos(d*x^2 
 + c)*log(-I*cos(d*x^2 + c) + sin(d*x^2 + c) + 1) - 3*(a*b*d^2*x^4 - b^2*d 
*x^2 - a*b*c^2 - b^2*c)*cos(d*x^2 + c)*log(-I*cos(d*x^2 + c) - sin(d*x^2 + 
 c) + 1) + 3*(a*b*c^2 - b^2*c)*cos(d*x^2 + c)*log(-cos(d*x^2 + c) + I*sin( 
d*x^2 + c) + I) - 3*(a*b*c^2 + b^2*c)*cos(d*x^2 + c)*log(-cos(d*x^2 + c) - 
 I*sin(d*x^2 + c) + I))/(d^3*cos(d*x^2 + c))
 
3.1.8.6 Sympy [F]

\[ \int x^5 \left (a+b \sec \left (c+d x^2\right )\right )^2 \, dx=\int x^{5} \left (a + b \sec {\left (c + d x^{2} \right )}\right )^{2}\, dx \]

input
integrate(x**5*(a+b*sec(d*x**2+c))**2,x)
 
output
Integral(x**5*(a + b*sec(c + d*x**2))**2, x)
 
3.1.8.7 Maxima [F]

\[ \int x^5 \left (a+b \sec \left (c+d x^2\right )\right )^2 \, dx=\int { {\left (b \sec \left (d x^{2} + c\right ) + a\right )}^{2} x^{5} \,d x } \]

input
integrate(x^5*(a+b*sec(d*x^2+c))^2,x, algorithm="maxima")
 
output
1/6*a^2*x^6 + (b^2*x^4*sin(2*d*x^2 + 2*c) + (d*cos(2*d*x^2 + 2*c)^2 + d*si 
n(2*d*x^2 + 2*c)^2 + 2*d*cos(2*d*x^2 + 2*c) + d)*integrate(4*(a*b*d*x^5*co 
s(2*d*x^2 + 2*c)*cos(d*x^2 + c) + a*b*d*x^5*cos(d*x^2 + c) + (a*b*d*x^5*si 
n(d*x^2 + c) - b^2*x^3)*sin(2*d*x^2 + 2*c))/(d*cos(2*d*x^2 + 2*c)^2 + d*si 
n(2*d*x^2 + 2*c)^2 + 2*d*cos(2*d*x^2 + 2*c) + d), x))/(d*cos(2*d*x^2 + 2*c 
)^2 + d*sin(2*d*x^2 + 2*c)^2 + 2*d*cos(2*d*x^2 + 2*c) + d)
 
3.1.8.8 Giac [F]

\[ \int x^5 \left (a+b \sec \left (c+d x^2\right )\right )^2 \, dx=\int { {\left (b \sec \left (d x^{2} + c\right ) + a\right )}^{2} x^{5} \,d x } \]

input
integrate(x^5*(a+b*sec(d*x^2+c))^2,x, algorithm="giac")
 
output
integrate((b*sec(d*x^2 + c) + a)^2*x^5, x)
 
3.1.8.9 Mupad [F(-1)]

Timed out. \[ \int x^5 \left (a+b \sec \left (c+d x^2\right )\right )^2 \, dx=\int x^5\,{\left (a+\frac {b}{\cos \left (d\,x^2+c\right )}\right )}^2 \,d x \]

input
int(x^5*(a + b/cos(c + d*x^2))^2,x)
 
output
int(x^5*(a + b/cos(c + d*x^2))^2, x)